package cn.highedu.feignclient.demos;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(url = "http://localhost:8080/", name = "hello-service")
public interface HelloService {

    /**
     * 调用hello方法时候，会通过feignClient调用http://localhost:8080/服务的/hello/{name}接口
     * @param name 名称，传递给服务的参数
     * @return 返回值，远程服务的返回值
     */
    @GetMapping("/hello/{name}")
    String hello(@PathVariable(name = "name") String name);
}
